package com.evan.designpatterns.prototype.simple;

import java.util.List;

/**
 * @author :liujiapeng01
 * @date :2019-03-14 12:55
 **/
public class ConcretePrototypeA implements Prototype {


    private String name;

    private int age;


    private List<String> list;

    public String getName() {
        return name;
    }

    public int getAge() {
        return age;
    }

    public List<String> getList() {
        return list;
    }

    public ConcretePrototypeA(String name, int age, List<String> list) {
        this.name = name;
        this.age = age;
        this.list = list;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }

    @Override
    public Prototype createClone() {
        try {
            return (Prototype) clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return null;
    }
}
